# Maintainer:  Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=cmph
pkgver=2.0.2
pkgrel=0
pkgdesc="A minimal hash C library - utility application"
url="http://cmph.sourceforge.net/"
arch="all"
license="LGPL-2.0-or-later MPL-1.1"
subpackages="$pkgname-dev $pkgname-doc libcmph:lib"
source="https://downloads.sourceforge.net/cmph/cmph-$pkgver.tar.gz"

build() {
	cd "$builddir"
	./configure \
		--disable-static \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

lib() {
	pkgdesc="A minimal perfect hash C library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libcmph*.so.* "$subpkgdir"/usr/lib/
}

sha512sums="014367a338e3e851cab76e45d7db3124da8bd04a05a0232ca8252f3eea515e9fcb0a8654f42d802469c419946a6e99113da3df2df8bc8a93843500bbede2a7a3  cmph-2.0.2.tar.gz"
